package org.javaboy.redis.common;

import java.util.Collection;
import java.util.concurrent.TimeUnit;

public interface RedisService<K, V> {
    void set(K key, V value);

    void set(K key, V value, final long timeout, final TimeUnit unit);

    V get(K key);

    Boolean delete(K key);

    Long delete(Collection<K> keys);

    Boolean hasKey(K key);

    Boolean expire(K key, long timeout, TimeUnit unit);

    Long getExpire(K key);

    Boolean setIfAbsent(K key, V value, long timeout, TimeUnit unit);
}
